using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Helper;
namespace CoreData
{
    public class Receipt_Other
    {
            public long ID{get;set;}
            public string PaymentNo{get;set;}
            public DateTime PaymentDate{get;set;}
            public Decimal Amount{get;set;}
            public long Payment_MethodID{get;set;}
            public long Payment_ReasonID{get;set;}
            public long StaffID{get;set;}
            public string Description{get;set;}
            public long CreatedBy{get;set;}
            public DateTime CreatedDate{get;set;}
            public long LastModifiedBy{get;set;}
            public DateTime LastModifiedDate{get;set;}
         
        public Receipt_Other()
        {       
                            PaymentNo ="";   
                            Description ="";   
        }
        
       static Receipt_Other DynamicCast<T>(object row_data, object row_header) where T : Receipt_Other
       {
           // row_data : DataRow
           // row_header : DataColumnCollection
           Receipt_Other ret = new Receipt_Other();
           DataRow dt = (DataRow)row_data;

           foreach (DataColumn column in (DataColumnCollection)row_header)
           {
               switch (column.ColumnName)
               {
                      case  "ID":
                        ret.ID = ConvertObject.ToLong(dt[column]);
                       break;
                      case  "PaymentNo":
                        ret.PaymentNo = ConvertObject.ToString(dt[column]);
                       break;
                      case  "PaymentDate":
                        ret.PaymentDate = ConvertObject.ToDateTime(dt[column]);
                       break;
                      case  "Payment_MethodID":
                        ret.Payment_MethodID = ConvertObject.ToLong(dt[column]);
                       break;
                      case  "Payment_ReasonID":
                        ret.Payment_ReasonID = ConvertObject.ToLong(dt[column]);
                       break;
                      case  "StaffID":
                        ret.StaffID = ConvertObject.ToLong(dt[column]);
                       break;
                      case  "Description":
                        ret.Description = ConvertObject.ToString(dt[column]);
                       break;
                      case  "CreatedBy":
                        ret.CreatedBy = ConvertObject.ToLong(dt[column]);
                       break;
                      case  "CreatedDate":
                        ret.CreatedDate = ConvertObject.ToDateTime(dt[column]);
                       break;
                      case  "LastModifiedBy":
                        ret.LastModifiedBy = ConvertObject.ToLong(dt[column]);
                       break;
                      case  "LastModifiedDate":
                        ret.LastModifiedDate = ConvertObject.ToDateTime(dt[column]);
                       break;
                
                   default:
                       break;
               }
           }

           return ret;
       }
        
    }
}
